﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel;

namespace GPMS.Model
{
    [MetadataType(typeof(UserInfoMetaData))]
    public partial class UserInfo
    {

        public UserInfo()
        {
            this.IsLocked = false;
            this.IsDeleted = false;
            this.Sex = null;
            this.UserIdentity = "000";
        }
        
        public class UserInfoMetaData
        {
            [ScaffoldColumn(false)]
            public object UserID { get; set; }

            [DisplayName("学号/工号")]
            [Required(ErrorMessage = "必须输入学号/工号")]
            [RemoteCustom("CheckUserIsExist", "Verify", ErrorMessage = "已存在学号/工号")]
            public object UserName { get; set; }

            [DisplayName("密码")]
            [Required(ErrorMessage = "必须输入密码")]
            [RegularExpression(@"([a-zA-Z0-9]|[.,;`~!@#$%^&*\-_=+\\|]){5,15}",ErrorMessage="5~15位，无生僻字符")]
            [DataType(DataType.Password)]
            public object Password { get; set; }

            [DisplayName("真实姓名")]
            [Required(ErrorMessage = "必须输入真实姓名")]
            public object RealName { get; set; }

            [DisplayName("用户标识")]
            [Required(ErrorMessage = "必须输入学号/工号")]
            [RegularExpression(@"\d{1,}",ErrorMessage="必须输入正确的格式")]
            [RemoteCustom("UserIdentity", "Verify", ErrorMessage = "该学号/工号已经注册")]
            public object UserIdentity { get; set; }

            [DisplayName("电子邮箱")]
            [Required(ErrorMessage = "必须输入电子邮箱")]
            [DataType(DataType.EmailAddress)]
            public object Email { get; set; }

            [DisplayName("性别")]
            public object Sex { get; set; }

            [DisplayName("生日")]
            public object Birthday { get; set; }

            //[DisplayName("用户类别")]
            //public object CategoryID { get; set; }

            [DisplayName("所属系")]
            public object SpecialtyID { get; set; }

            [DisplayName("电话")]
            public object Phone { get; set; }

            [DisplayName("QQ/MSN")]
            public object IM { get; set; }
        }

        
    }
}